home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2007 January, February, March & April
/
Chip-Cover-CD-2007-02.iso
/
Pakiet multimedia
/
Animacje, filmy i prezentacje
/
Edytory i konwertery filmow
/
MediaCoder 0.5.1 pre12
/
MediaCoder-0.5.1-pre12.exe
/
htdocs
/
extensions
/
extension.js
< prev
next >
Wrap
Text File
|
2006-08-29
|
2KB
|
93 lines
function CreateXMLHttp()
{
var xmlhttp = window.XMLHttpRequest ? new XMLHttpRequest : new ActiveXObject("Microsoft.XMLHTTP");
if (!xmlhttp) alert("XMLHttpRequest object cannot be created.");
return xmlhttp;
}
function NewXML(rootkey)
{
var xmlDoc;
if (document.implementation && document.implementation.createDocument)
{
xmlDoc = document.implementation.createDocument("", rootkey, null);
}
else if (window.ActiveXObject)
{
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
}
else
{
return;
}
return xmlDoc;
}
function LoadXMLFile(xmlfile)
{
var xmlDoc;
if (document.implementation && document.implementation.createDocument)
{
xmlDoc = document.implementation.createDocument("", "", null);
//xmlDoc.onload = callback;
}
else if (window.ActiveXObject)
{
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.onreadystatechange = function () {
//if (xmlDoc.readyState == 4) callback()
};
}
else
{
return;
}
xmlDoc.async = false;
try {
if (!xmlDoc.load(xmlfile)) return null;
}
catch (ex)
{
return null;
}
return xmlDoc;
}
function AddPrefNode(doc, path, value)
{
var i;
var tokens = path.split('.');
var node = doc.firstChild;
var newnode;
for (i = 0; i < tokens.length; i++) {
newnode = doc.createElement("node");
newnode.setAttribute("key", tokens[i]);
node = node.appendChild(newnode);
}
node.setAttribute("value", value);
}
function PostPrefXML(data)
{
var xmlhttp = CreateXMLHttp();
xmlhttp.open("POST", "/pref/import", false);
xmlhttp.send(data);
if (xmlhttp.responseText != "OK")
alert("Error posting preference data to MediaCoder.");
delete xmlhttp;
}
function SendCommand(cmd)
{
var xmlhttp = CreateXMLHttp();
xmlhttp.open("GET", "/ui?cmd=" + cmd, false);
xmlhttp.send(null);
delete xmlhttp;
}
function SetWindowSize(width, height)
{
window.innerWidth = width;
window.innerHeight = height;
}